package com.atguigu.gmall.order.biz;

import com.atguigu.gmall.enums.OrderStatus;
import com.atguigu.gmall.order.vo.OrderConfirmDataVo;
import com.atguigu.gmall.order.vo.OrderSpiltResultVo;
import com.atguigu.gmall.order.vo.OrderSubmitDataVo;

import java.util.List;

/**
 * @author lfy
 * @Description
 * @create 2023-08-01 14:37
 */
public interface OrderBizService {
    OrderConfirmDataVo getConfirmData();


    /**
     * 提交订单
     * @param tradeNo
     * @param submitDataVo
     * @return
     */
    Long submitOrder(String tradeNo, OrderSubmitDataVo submitDataVo);

    /**
     * 保存订单数据
     * @param tradeNo
     * @param submitDataVo
     * @return
     */
    Long saveOrderInfo(String tradeNo, OrderSubmitDataVo submitDataVo);


    /**
     * 保存订单明细
     * @param orderId
     * @param submitDataVo
     */
    void saveOrderDetail(Long orderId, OrderSubmitDataVo submitDataVo);

    /**
     * 保存订单状态信息
     * @param orderId
     * @param status
     */
    void saveOrderStatus(Long orderId, OrderStatus status);

    /**
     * 关闭订单
     * @param orderId
     * @param userId
     */
    void closeDeadOrder(Long orderId, Long userId);

    /**
     * 订单状态修改为已支付
     * @param outTradeNo
     */
    void orderPayedStatusChange(String outTradeNo);

    /**
     * 订单状态改为 待发货/等待调货
     * @param orderId
     * @param status
     */
    void orderDeductStatusChange(Long orderId, String status);


    /**
     * 订单拆分
     * @param orderId
     * @param wareSkuMap
     * @return
     */
    List<OrderSpiltResultVo> spiltOrder(Long orderId, String wareSkuMap);
}
